/*
 *                    COPYRIGHT NOTICE
 *
 *           This code is copyright protected by Freedom Inc.
 *
 *              2001-2012 All Rights Are Reserved
 */
package com.freedom.oldsong.hr.resource.action;

import com.freedom.oldsong.hr.HRListBaseAction;
import com.freedom.oldsong.hr.resource.service.HRDashBoardService;
import com.freedom.oldsong.json.JSONWriteUtils;
import com.freedom.oldsong.system.dto.PaginationResult;
import com.freedom.oldsong.util.LanguageUtil;

/**
 * @author steven.wang
 *
 */
public class HRDashBoardAction extends HRListBaseAction {

	private HRDashBoardService service;
	
	/**
	 * view page
	 * @return
	 */
	public String dashboard(){
		getUser();
		service.testMethod();
		return "dashboard";
	}
	
	/**
	 * view page
	 * @return
	 */
	public String viewList(){
		initPagination();
		pageResult = new PaginationResult();
		return "viewList";
	}
	
	
	/**
	 * save or update, ajax
	 */
	public void saveOrUpdateOrDelete(){
		try{
			jasonMap.put("result",LanguageUtil.getText("error_contact_admin", getLanguage()));
		}catch(Exception e){
			errors.add(LanguageUtil.getText("error_contact_admin", getLanguage()));
			jasonMap.put("Errors", errors);
		}
		JSONWriteUtils.sendResult(jasonMap);
	}

	public void setService(HRDashBoardService service) {
		this.service = service;
	}
}
